package easy;

import java.util.Arrays;

public class T26 {
    public T26(int[] nums) {
        int j = 1;
        int i = 1;

        while (i<nums.length && j<nums.length){
            if (nums[j] != nums[i-1]) {
                nums[i] = nums[j];
                i++;
            }
            j++;
        }

        System.out.println(i);
        System.out.println(Arrays.toString(nums));
    }
}
